package com.ltedu.course.domain.vo;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ltedu.common.serializer.LongJsonDeserializer;
import com.ltedu.common.serializer.LongJsonSerializer;
import com.ltedu.common.validate.Create;
import com.ltedu.common.validate.Update;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @className: CategoryVO
 * @auther: Jerry
 * @date: 2020/12/8 10:37
 * @desctiption: TODO
 * @version: 1.0
 */
public class CategoryVO implements Serializable {
    private static final long serialVersionUID = 5079768908992016529L;

    /**
     * 主键
     */
    @JsonDeserialize(using = LongJsonDeserializer.class)
    @JsonSerialize(using = LongJsonSerializer.class)
    @NotNull(groups = Update.class, message = "id不能为空")
    private Long id;

    /**
     * 父id
     */
    @JsonDeserialize(using = LongJsonDeserializer.class)
    @JsonSerialize(using = LongJsonSerializer.class)
    @NotNull(groups = Create.class, message = "父id不能为空")
    @NotNull(groups = Update.class, message = "父id不能为空")
    private Long parentId;

    /**
     * 类别名称
     */
    @NotEmpty(groups = Create.class, message = "类别名称不能为空")
    @NotEmpty(groups = Update.class, message = "类别名称不能为空")
    private String name;

    /**
     * 状态(1:正常，0:禁用)
     */
    @NotNull(groups = Create.class, message = "状态不能为空")
    @NotNull(groups = Update.class, message = "状态不能为空")
    private Integer state;

    /**
     * 排序
     */
    @NotNull(groups = Create.class, message = "排序不能为空")
    @NotNull(groups = Update.class, message = "排序不能为空")
    private Integer sort;

    /**
     * 备注
     */
    private String remark;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
